Skip to content

feat(python-sdk): validate config#72

Open
czi-fsisenda wants to merge 4 commits into
mainfrom
fsisenda/sdk_python_validate_config
Open

feat(python-sdk): validate config#72
czi-fsisenda wants to merge 4 commits into
mainfrom
fsisenda/sdk_python_validate_config

Conversation

@czi-fsisenda
Copy link
Copy Markdown
Contributor

@czi-fsisenda czi-fsisenda commented May 20, 2026

Summary

  • EvaluatorConfig is validated at evaluator construction and when doing evaluations.
  • Fail fast if config missing info needed to support the evaluator or evaluation run.

Test plan

  • Unit tests

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds fail-fast validation in the Python SDK to ensure an EvaluatorConfig includes provider configs for every LLMProvider referenced by the active EvaluationSettings (both at evaluator construction time and per-evaluation).

Changes:

  • Added EvaluatorConfig.validate_supports_evaluation_settings() plus provider discovery over PromptSettings fields on EvaluationSettings.
  • Enforced provider-config validation in BaseEvaluator.__init__ (resolved defaults) and at the start of BaseEvaluator.evaluate() (per-run settings).
  • Updated unit/contract tests and test fixtures to supply provider configs where evaluators’ defaults require them; added targeted validation tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdks/python/src/learning_commons_evaluators/schemas/config.py Introduces provider requirement detection from settings and config validation with ConfigurationError.
sdks/python/src/learning_commons_evaluators/evaluators/base.py Calls config validation during evaluator init and before each evaluation run.
sdks/python/README.md Documents new provider config validation behavior and where it runs.
sdks/python/tests/conftest.py Adds fixtures providing Google / Google+OpenAI configs for tests.
sdks/python/tests/schemas/test_config.py Adds unit tests for validate_supports_evaluation_settings() behavior (no-op, missing provider(s), multiple providers).
sdks/python/tests/evaluators/test_base.py Adds tests ensuring init/evaluate raise ConfigurationError when required provider config is missing.
sdks/python/tests/evaluators/test_vocabulary.py Updates tests to use provider-configured fixtures due to new validation.
sdks/python/tests/evaluators/test_conventionality.py Updates tests to use provider-configured fixture due to new validation.
sdks/python/tests/contract_tests/test_vocabulary.py Updates contract tests to use provider-configured fixture due to new validation.
sdks/python/tests/contract_tests/test_conventionality.py Updates contract tests to use provider-configured fixture due to new validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sdks/python/src/learning_commons_evaluators/evaluators/base.py
@czi-fsisenda czi-fsisenda marked this pull request as ready for review May 20, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants